/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Controladores;

import Modelo.Tatica;
import Modelo.Time;
import Visão.TelaPrincipal;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class ControleTatica implements ActionListener {
    private Time time;
    private TelaPrincipal telaPrincipal;
    
    public ControleTatica(Time A){
        this.time = A;
    }
    
    public void mostarTela(){
        new TelaPrincipal().getTelaTime().setVisible(true);
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        Tatica tatica = Tatica.getInstace();
        tatica.setEstiloJogo((String) telaPrincipal.getTelaTatica().getjComboBox1().getSelectedItem());
        tatica.setTaticaFormação((String) telaPrincipal.getTelaTatica().getjComboBox2().getSelectedItem());
        tatica.setTipoAtaque((String) telaPrincipal.getTelaTatica().getjComboBox3().getSelectedItem());
        tatica.setTipoMarcacao((String) telaPrincipal.getTelaTatica().getjComboBox4().getSelectedItem());
        time.setTatica(tatica);
    }
}
